/*

*/
cast_bar
	var
		player/target
		max_time

	proc
		end()
			target.can_cast=TRUE
			winset(target,"default.castbar","is-visible=false")
			del src

	New(mob/targt, time)
		if(!isplayer(targt))del src
		..()
		if(time <= 0)return
		max_time		= time
		target			= targt
		target.can_cast	= FALSE

		winset(target,"default.castbar","is-visible=true")
		while(time > 0)
			time --
			winset(target, "default.castbar","value=[bar_safe(time, max_time)]")
			sleep(1)
		end()